#  Copyright (c) 2022. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
#  Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
#  Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
#  Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
#  Vestibulum commodo. Ut rhoncus gravida arcu.

# coding:utf8
from selenium.webdriver.edge.webdriver import WebDriver

from project.SipMachine.pages.base_page import BasePage
from project.SipMachine.utils.locators import BaiduPageLocators
from project.SipMachine.pack.make_driver import driver
from log import logger


class BaiduPage(BasePage):
    def __init__(self, driver, base_url=''):
        """ """
        self.loc = BaiduPageLocators()
        super(BaiduPage, self).__init__(driver, base_url)

    def login(self):
        print(self.get_title())
        print(self.get_url())
        logger.debug("title: {}".format(self.get_title()))
        logger.debug("url: {}".format(self.get_url()))
        self.hover(self.loc.some)
        self.send_keys(self.loc.input, "nihao")
        self.sleep(3)
        self.click_button(self.loc.btn_search)
        


def main():
    url = "https://www.baidu.com"
    obj = BaiduPage(driver, base_url=url)
    obj.open()
    obj.login()
    
main()




